package query

import (
    "ginweb/internal/domain/user"
)

type UserService struct {
    userRepository user.Repository
}

func NewUserService(userRepo user.Repository) *UserService {
    return &UserService{
        userRepository: userRepo,
    }
}

func (us *UserService) GetUsers() ([]user.User, error) {
    return us.userRepository.FindAll()
}

func (us *UserService) CreateUser(user user.User) error {
    return us.userRepository.Save(user)
}